package com.test.learnaidl.binderimp;

import android.os.IBinder;
import android.os.RemoteException;

import com.test.learnaidl.IBinderPoolInterface;

public class BinderPoolImpl extends IBinderPoolInterface.Stub {
    public static final int BINDER_CODE_PERSON=1;
    public static final int BINDER_CODE_PERSON_MANNAGE=2;
    public static final int BINDER_CODE_TOOL=3;
    @Override
    public IBinder queryBinder(int binderCode) throws RemoteException {
        IBinder iBinder = null;
        switch (binderCode) {
            case BINDER_CODE_PERSON:
                iBinder = new PersonImpl();
                break;
            case BINDER_CODE_PERSON_MANNAGE:
                iBinder = new PersonMannageImpl();
                break;
            case BINDER_CODE_TOOL:
                iBinder = this;
                break;
            default:
                break;
        }
        return iBinder;
    }
}
